import Cookies from 'js-cookie'

const TokenKey = 'hm_158_token'

/**
 * 获取token
 * @returns token
 */
export function getToken() {
  return Cookies.get(TokenKey)
}

/**
 * 本地存储token
 * @param {string} token 用户登录后获取的token
 */
export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

/**
 * 删除token
 */
export function removeToken() {
  return Cookies.remove(TokenKey)
}
